#ifndef CUSTOMOBJECTSECTION_H
#define CUSTOMOBJECTSECTION_H

#include "Framework/Prerequisites.h"
#include "Graphics/IRenderable.h"
#include "Graphics/IRenderOperation.h"
#include "IO/ResourceGroupManager.h"
#include "Graphics/MaterialManager.h"
#include "Graphics/Material.h"

namespace tyro
{
	namespace Geometry
	{
		class CustomObjectSection : public Graphics::IRenderable
		{
		public:

			CustomObjectSection(CustomObject* parent, 
								const String& materialName,
								Graphics::MaterialManager* matMgr,
								RenderType renderType, 
								const String & groupName = IO::ResourceGroupManager::DEFAULT_GROUP_NAME
								);

			Graphics::IRenderOperation* GetRenderOperation(void);
			void						GetRenderOperation(Graphics::IRenderOperation& op);
			const Graphics::MaterialPtr& GetMaterial(void) const;
			void GetWorldTransforms(Math::Matrix4f* mat) const;

			bool Is32BitIndices() const;
			void Set32BitIndex( bool is32BitIndeces );
		protected:

			CustomObject*					parent;
			String							materialName;
			String							groupName;
			Graphics::IRenderOperation		renderOperation;
			bool							is32BitIndices;
			mutable Graphics::MaterialPtr	activeMaterial;
			Graphics::MaterialManager*		matManager;

		private:
		};
	}
}
#endif